export const searchQuery = search => {
  const query = {};
  if (search && search.length > 1) {
    search
      .slice(1)
      .split("&")
      .forEach(item => {
        let [key, ...values] = item.split("=");
        query[key] = decodeURI(values.join("=")) || true;
        // query[key] = decodeURI(values.join("=").replace(/%/g, "%25")) || true;
      });
  }
  return query;
};
/**
 * 用于分割歌单填充swiper
 * @param {*} list 被分割歌单
 * @param {*} size 每页大小
 * @returns 
 */
export const spliceSongLit = (list, size) => {
  let arr = []
  list.forEach((item, index) => {
    let i = parseInt(index / size);
    if(!arr[i]) {
      arr[i] = []
    }
    arr[i].push(item)
  })
  return arr
};